package com.lanyun.serviceimpl;

import com.lanyun.dao.ProductDao;
import com.lanyun.pojo.Product;
import com.lanyun.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductDao productDao;
    @Override
    public List<Product> getAll() {
        return productDao.getAll();
    }

    @Override
    public List<Product> getProductByType(String typeid) {
        return productDao.getProductByType(typeid);
    }

    @Override
    //根据仓库ID查商品
    public List<Product> gerProductByWarehouseId(Integer id) {
        return productDao.gerProductByWarehouseId(id);
    }

    // 根据供应商ID 获取到与供应商相关的商品
    @Override
    public List<Product> getProductByType(Integer id) {
        return null;
    }

    @Override
    public List<Product> getProductBySupID(Integer id) {
        return productDao.getProductBySupID(id);
    }

    // 查出单独的商品
    @Override
    public Product GetProductByone(String id) {
        return productDao.GetProductByone(id);
    }

    @Override
    public Double GetPrice(String id, String ids) {
        return productDao.GetPrice(id,ids);
    }
}
